<template>
  <div class="home">
    <el-page-header  content="主页">
            </el-page-header>

            <h1><span>欢迎您~!{{users.name}}</span><el-button type="info" @click="outLogin">退出登录</el-button></h1>
  </div>
</template>

<script>
// @ is an alias to /src
import {mapState} from "vuex"
export default {
  name: 'Home',
  computed:{
    ...mapState({
      users:(state)=>state.login.users
    })
  },
  methods:{
    outLogin(){
      localStorage.clear()
      this.$router.push('/')
    }
  }
}
</script>
<style lang="scss">
  .home{
    width: 100%;
    height: 100%;
    background: #fff;
     h1{
      display: flex;
      justify-content: space-between;
      padding: 30px 20px;
    }
  }
</style>